import java.util.Scanner;
import java.util.regex.*;

class Employee {
    String name;
    String address;
    String phoneNumber;
    Scanner input = new Scanner(System.in);
    
    public Employee() {
        name = "";
        address = "";
        phoneNumber = "";
    }
    
    public void standardizeAdd() {
        String a = this.address;
        String[] str = {"street", "drive", "road", "\\s+"};
        
        for (int i = 0; i < 10; i++) {
            Pattern pat = Pattern.compile(str[i], Pattern.CASE_INSENSITIVE);
            Matcher mat = pat.matcher(a);
            for(int j =0; i < a.length(); j++) {
                while(mat.find()){
                    switch(i) {
                        case 0:
                            a = mat.replaceAll("St");
                            break;
                        case 1:
                            a = mat.replaceAll("Dr");
                            break;
                        case 2:
                            a = mat.replaceAll("Rd");
                            break;
                        case 3:
                            a = mat.replaceAll(" ");
                            break;
                    }
                }
            }
        }
        this.address = a;
    }
    
    public void standardizePhone() {
        String p = this.phoneNumber;
        Pattern pat = Pattern.compile("\\D",Pattern.CASE_INSENSITIVE);
        Matcher mat = pat.matcher(p);
        
        for (int i = 0; i < p.length(); i++) {
            while(mat.find()){
                p = mat.replaceAll("-");
            }
        }
        this.phoneNumber = p;
    }
    
    public void display() {
        System.out.format("%1$20s %2$20s %3$15s\n",
                this.name, this.address, this.phoneNumber);
    }
}

class Administrator {
    
    
    public Administrator() {
        
    }
    
    public static void main(String[] args) {
        int nEmployee = 0;
        int choice;
        Scanner input = new Scanner(System.in);
        input.useDelimiter("\n");
        Employee[] emp = new Employee[10];
        for (int i = 0; i < 10; i++) {
            emp[i] = new Employee();
        }
        do {
            System.out.println("  ***   EMPLOYEE MANAGERMENT   ***");
            System.out.println("  1.Add new employee");
            System.out.println("  2.Display all");
            System.out.println("  3.Exit");
            System.out.println("******************************");
            System.out.print("  Enter your choice (1-3): ");
            choice = input.nextInt();
            
            switch (choice) {
                case 1:
                    System.out.print("Enter Emp's name: ");
                    emp[nEmployee].name = input.next();
                    System.out.print("Enter Emp's address: ");
                    emp[nEmployee].address = input.next();
                    emp[nEmployee].standardizeAdd();
                    System.out.print("Enter Emp's phone number: ");
                    emp[nEmployee].phoneNumber = input.next();
                    emp[nEmployee].standardizePhone();
                    nEmployee++;
                    break;
                case 2:
                    System.out.println("*** Employee Detail ***");
                    System.out.format("%1$-20s %2$-20s %3$-15s\n",
                            "Name", "Address", "Phone Number");
                    for (int i = 0; i < nEmployee; i++) {
                        emp[i].display();
                    }
                    break;
            }
        } while (choice != 3);
    }
}